{% extends "personal_center/base.html" %}

{% block page_link %}
    <link rel="stylesheet" href="../../static/public_file/css/PersonnelChooser.css">
{% endblock %}


{% block style %}
    <style>
        .add_class {
            background: #1E90FF;
        }

        .add_background {
            background: #A9A9A9;
        }

        tr {
            height: 35px;
        }

        th {
            text-align: center;
        }

        table {
            table-layout: fixed;
        }

        td:first-child, th:first-child {
            position: sticky;
            left: 0; /* 首行永远固定在左侧 */
            z-index: 1;
        }

        thead tr th {
            position: sticky;
            top: 0; /* 列首永远固定在头部  */
            background-color: #E8E8E8;
        }

        th:first-child {
            z-index: 2;
        }

        .li-class {
            list-style: none;
            margin-top: 2%;
            color: #0b0b0b;
            cursor: pointer;
        }

        #Table td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table1 td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table2 td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table3 td {
            text-align: center;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #t_table4 td {
        {#text-align: center;#} color: #0b0b0b;
            cursor: pointer;
            border-bottom: #F2F2F2 solid 1px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
        }

        #Table tr:hover {
            background: #D8D8D8;
            color: white;
        }

        #Table1 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        #Table2 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        #Table3 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        #t_table4 tr:hover {
            background: #D8D8D8;
            color: white;
        }

        .top_tag {
            border-bottom: #01AAED solid 2px;
            color: #01AAED;
        }

        .tab_top {
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            display: inline-block;
            cursor: pointer;
        }

        .search {
            width: 300px;
            display: flex;
            float: right;
            margin: 10px 0;
            margin-right: 1%;
            /*border: 1px solid red;*/
        }

        .search input {
            vertical-align: middle;
            float: left;
        / / 左浮动 flex: 4;
            height: 30px;
            width: 230px;
            outline: none;
            border: 1px solid #0070c1;
            box-sizing: border-box;
        / / 盒子模型，怪异IE盒子模型，width = content + border * 2 + padding * 2 padding-left: 10 px;
            border-bottom-left-radius: 3px;
            border-top-left-radius: 3px;
        }

        .search button {
            float: right;
            flex: 1;
            height: 30px;
            width: 70px;
            line-height: 30px;
            background-color: #0070c1;
            color: white;
            border-style: none;
            outline: none;
            border-bottom-right-radius: 3px;
            border-top-right-radius: 3px;
        }

        .search button i {
            font-style: normal;
        }

        .search button:hover {
            font-size: 16px;
        }

        .shadow_tab {
            box-shadow: #01AAED 0 0 10px;
        }

        .shadow_tab_1 {
            width: 20%;
            height: 80px;
            border: #cfcfcf solid 1px;
            margin: 1%;
            display: inline-block;
            vertical-align: top;
            cursor: pointer;
        }

        .a_tag_cla {
            display: block;
            /*超出隐藏*/
            overflow: hidden;
            /*禁止换行*/
            white-space: nowrap;
            /*超出用省略号代替*/
            text-overflow: ellipsis;
            height: 30px;
            line-height: 30px;
            padding-left: 1%;
        }

        #addForm {
            width: 800px;
            height: 620px;
            background: #F5F5F5;
            position: absolute;
            border: #dfdfdf solid 1px;
            margin: auto;
            border-radius: 3px;
            top: 50%;
            left: 50%;
            /* 实现鼠标拖拽使用css3效果 */
            transform: translate(-50%, -50%);
            display: none;
            z-index: 10100;
            font-size: 0;
        }

        #addForm1 {
            width: 800px;
            height: 620px;
            background: #F5F5F5;
            position: absolute;
            border: #dfdfdf solid 1px;
            margin: auto;
            border-radius: 3px;
            top: 50%;
            left: 50%;
            /* 实现鼠标拖拽使用css3效果 */
            transform: translate(-50%, -50%);
            display: none;
            z-index: 10100;
            font-size: 0;
        }

        #title1 {
            display: flex;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 0 10px;
            height: 50px;
            color: #0b0b0b;
            cursor: move;
            /*border: #dfdfdf solid 1px;*/
            width: 100%;
            background: #f4f7fa;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
        }

        .div_clase {
            display: inline-block;
            width: 300px;
            height: 30px;
            line-height: 30px;
            font-size: 14px;
            color: #0b0b0b;
        }

        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }

        .input-style {
            display: inline-block;
            width: 100%;
            height: 35px;
            font-size: 14px;
            border: none;
            background: white;
        }

        .button_for_control {
            width: 90px;
            height: 30px;
            border: 1px solid #99D3F5;
            background: #D0EEFF;
            border-radius: 4px;
            letter-spacing: 0;
            line-height: 30px;
            color: #089bab;
        }

        #page_one button:hover {
            color: red;
        }

        .approve {
            display: none;
        }

        .shade1 {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(36, 36, 36, 0.5);
            display: none;
            z-index: 10000;
        }

        #addForm2 {
            width: 700px;
            height: 600px;
            background: #F5F5F5;
            position: absolute;
            border: #dfdfdf solid 1px;
            margin: auto;
            border-radius: 3px;
            top: 50%;
            left: 50%;
            /* 实现鼠标拖拽使用css3效果 */
            transform: translate(-50%, -50%);
            z-index: 10100;
        }

        #title {
            display: flex;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 0 10px;
            height: 50px;
            color: #0b0b0b;
            cursor: move;
            /*border: #dfdfdf solid 1px;*/
            width: 100%;
            background: #f4f7fa;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
        }
        #ThreeNavigation div {
            padding-left: 2%;
        }
    </style>
{% endblock %}


{% block right_content %}
    <div style="width: 100%;height: 40px;background: white;border-bottom: #A9A9A9 solid 0.5px;line-height: 40px;padding-left: 1%;color: black;">
        <div id="DW_tag" class="tab_top top_tag" onclick="change_mind('DW')">
            申请详情
        </div>

        <div id="XZ_tag" class="tab_top" onclick="change_mind('XZ')">
            审批详情
        </div>

        <div id="LH_tag" class="tab_top" onclick="change_mind('LH')">
            附件
        </div>

        <div id="caozuo" style="width: 100px;float: right;text-align: center;margin-right: 1%;height: 40px;">
            <button onmousemove="page_zhanshi()" onmouseout="page_yincang()"
                    style="width: 100px;height: 30px;line-height: 27px;border: #1E90FF solid 1px;background: #1E90FF;color: white;margin-top: 5px;border-radius: 3px;">
                操作
            </button>
        </div>

        <div id="dowload_but"
             style="width: 110px;float: right;text-align: center;margin-right: 6px;height: 40px;display: none;">
            <button id="download"
                    style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                <ul class="nav navbar-nav navbar-right" style="height: 100%;position: relative;">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false" style="color: white;">
                        <span style="margin-left: 20px;">下载</span> <span class="caret"></span>
                    </a>
                    <li class="dropdown" style="width: 100%;height: 100%;">
                        <ul id="dowload_ul" class="dropdown-menu" style="width: 350px;margin-right: 100px;">

                        </ul>
                    </li>
                </ul>
            </button>
        </div>

        <div style="width: 110px;float: right;text-align: center;margin-right: 6px;height: 40px;">
            <button style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                <a href="javascript:history.go(-1)" style="color: white;">返回</a></button>
        </div>

        <div id="print_but"
             style="width: 110px;float: right;text-align: center;margin-right: 6px;height: 40px;display: none;">
            <button onclick="but_click()" id="print"
                    style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                预览
            </button>
        </div>
        <div id="page_one" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
             style="z-index: 1000; position: absolute; width: 100px; height: auto;right: 0.9%; top: 80px;background: #FFFFFF; box-shadow: rgb(204 204 204) 2px 2px 10px;padding: 5px;display: none;">
            <button id="approve" onclick="online_tag()" class="button_for_control approve">
                审批
            </button>

            <button id="is_stop" onclick="operate_button(this.id)" class="button_for_control">
                终止
            </button>
        </div>

        <div id="fenfa" style="float: right;width: 110px;text-align: center;height: 100%;display: none;">
            <button id="fenfa_button" onclick="ModelLine('ff')"
                    style="width: 100px;height: 30px;margin-top: 5px;border-radius: 3px;border: #1E90FF solid 1px;color: white;background-color: #1E90FF;line-height: 15px;">
                分发
            </button>
        </div>
        <div id="jiesu" style="float: right;width: 110px;text-align: center;height: 100%;display: none;">
            <button id="finish_button" onclick="do_finish()"
                    style="width: 100px;height: 30px;margin-top: 5px;border-radius: 3px;border: #1E90FF solid 1px;color: white;background-color: #1E90FF;line-height: 15px;">
                结束
            </button>
        </div>

        <div id="modification_button" style="float: right;width: 110px;text-align: center;height: 100%;display: none;">
            <button id="modification" onclick="summit_fun()"
                    style="width: 100px;height: 30px;margin-top: 5px;border-radius: 3px;border: #1E90FF solid 1px;color: white;background-color: #1E90FF;line-height: 15px;">
                修改
            </button>
        </div>
    </div>

    <div id="new_models" class="shade1">
        <div id="addForm2">
            <div id="title">
                <h5 id="modal-title" class="modal-title"
                    style="line-height: 50px;width: 15%;margin-left: 1%;display: inline-block;">上级来文</h5>
                <span onclick="close_models()"
                      style="float: right;line-height: 50px;padding-right: 2%;cursor: pointer;"><i
                        class="iconfont icon-quchu"></i></span>
            </div>
            <hr>
            <div style="width: 100%;height: 500px;overflow: auto;">
                <div id="yb_zr" style="height: 500px;width: 100%;padding-top: 2%;padding-left: 2%;">
                    <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;border-bottom: #cfcfcf solid 1px;padding-bottom: 1%;">
                        <input type="radio" onclick="please_find_opinion('a')" name="lwgd" value="a"> 留文存档
                    </div>
                    <div style="width: 100%;height: 50px;padding-left: 2%;line-height: 50px;">
                        <input onclick="please_find_opinion('b')" type="radio" name="lwgd" value="b"> 拟办意见
                    </div>

                    <div id="PleaseFindOpinion"
                         style="width: 100%;height: 200px;padding-left: 2%;padding-bottom: 1%;display: none;">
                        <div>
                            <label style="vertical-align: top;">审批意见：</label>
                            <textarea name="" id="opinion_detail_zr" cols="30" rows="2"
                                      style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                        </div>

                        <div style="margin-top: 2%;width: 100%;">
                            <label style="vertical-align: top;">审批人员：</label>
                            <br>
                            <input onclick="ModelLine('zr_xz')" id="zr_xz" type="text" placeholder="请选择审批人员"
                                   style="width: 98%;border: #cfcfcf solid 1px;height: 30px;">
                        </div>
                    </div>
                    <hr>

                    <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;border-bottom: #cfcfcf solid 1px;padding-bottom: 1%;">
                        <input type="radio" onclick="please_find_opinion('c')" name="lwgd" value="c"> 书记审批
                    </div>
                    <div id="sj_return_opinion" style="margin-top: 2%;width: 100%;display: none;">
                        <label style="vertical-align: top;">审批意见：</label>
                        <textarea name="" id="sj_opinion" cols="30" rows="5"
                                  style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                    </div>
                    <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;border-bottom: #cfcfcf solid 1px;padding-bottom: 1%;">
                        <input type="radio" onclick="please_find_opinion('d')" name="lwgd" value="d"> 院长审批
                    </div>
                    <div id="yz_return_opinion" style="margin-top: 2%;width: 100%;display: none;">
                        <label style="vertical-align: top;">审批意见：</label>
                        <textarea name="" id="yz_opinion" cols="30" rows="5"
                                  style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                    </div>
                    <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;border-bottom: #cfcfcf solid 1px;padding-bottom: 1%;">
                        <input type="radio" onclick="please_find_opinion('e')" name="lwgd" value="e"> 书记、院长
                    </div>
                    <div id="sy_return_opinion" style="margin-top: 2%;width: 100%;display: none;">
                        <label style="vertical-align: top;">审批意见：</label>
                        <textarea name="" id="sy_opinion" cols="30" rows="5"
                                  style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                    </div>
                    <div style="width: 100%;height: 50px;padding-left: 2%;line-height: 50px;">
                        <input onclick="please_find_opinion('g')" type="radio" name="lwgd" value="g"> 分发
                    </div>

                    <div id="DirectorDistribution"
                         style="width: 100%;height: 200px;padding-left: 2%;padding-bottom: 1%;display: none;">
                        <div>
                            <label style="vertical-align: top;">审批意见：</label>
                            <textarea name="" id="zr_ff_option" cols="30" rows="2"
                                      style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                        </div>

                        <div style="margin-top: 2%;width: 100%;">
                            <label style="vertical-align: top;">接收人员：</label>
                            <br>
                            <input onclick="ModelLine('zr_ff')" id="zr_ff" type="text" placeholder="请选择接收人员"
                                   style="width: 98%;border: #cfcfcf solid 1px;height: 30px;">
                        </div>
                    </div>
                    <hr>
                    <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;border-bottom: #cfcfcf solid 1px;padding-bottom: 1%;">
                        <input type="radio" onclick="please_find_opinion('f')" name="lwgd" value="f"> 退回
                    </div>
                    <div id="return_opinion" style="margin-top: 2%;width: 100%;display: none;">
                        <label style="vertical-align: top;">审批意见：</label>
                        <textarea name="" id="send_back" cols="30" rows="5"
                                  style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                    </div>
                </div>

                <div id="sj_yz" style="height: 500px;width: 100%;padding-top: 2%;padding-left: 2%;display: none;">
                    <div>
                        <input type="radio" name="check" onclick="disp_peo(1)" value="audit" checked> 同意
                        <input type="radio" name="check" style="margin-left: 3%;" value="draft" onclick="disp_peo(2)">
                        不同意
                    </div>
                    <div style="margin-top: 2%;width: 100%;">
                        <label style="vertical-align: top;">审批意见：</label>
                        <textarea name="" id="opinion_detail_sj_yz" cols="40" rows="15"
                                  style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                    </div>
                </div>

                <div id="sq_people" style="height: 500px;width: 100%;padding-top: 2%;padding-left: 2%;display: none;">
                    <div id="peoples_check" style="margin-top: 2%;width: 100%;">
                        <label style="vertical-align: top;">分管人员：</label>
                        <br>
                        <input onclick="ModelLine('ld_xz')" id="ld_xz" type="text" placeholder="请选择分管人员"
                               style="width: 98%;border: #cfcfcf solid 1px;border-radius: 3px;height: 30px;">
                    </div>
                </div>

                <div id="fg_ld" style="height: 500px;width: 100%;padding-top: 2%;padding-left: 2%;display: none;">
                    <div>
                        <input type="radio" name="check1" onclick="disp_peo1(1)" value="audit" checked> 同意
                        <input type="radio" name="check1" style="margin-left: 3%;" value="draft" onclick="disp_peo1(2)">
                        不同意
                    </div>
                    <div>
                        <label style="vertical-align: top;">审批意见：</label>
                        <textarea name="" id="opinion_detail_fg" cols="30" rows="15"
                                  style="width: 98%;border: #cfcfcf solid 1px;margin-top: 2%;outline: none;"></textarea>
                    </div>

                </div>
            </div>
            <hr>
            <div style="width: 100%;height: 50px;text-align: right;padding-right: 2%;">
                <button id="model_summit" onclick="summit_data()"
                        style="width: 100px;height: 30px;border: #dfdfdf solid 1px;margin-top: 10px;border-radius: 3px;background: #1E90FF;color: white;">
                    提交
                </button>
            </div>
        </div>
    </div>

    <div id="DW" style="width: 100%;height: 95%;background: white;">
        <div style="width: 100%;height: 40px;line-height: 40px;text-align: center;">
            <h3 id="manuscript_title">电 文 处 理 及 阅 文 笺</h3>
        </div>
        <hr>
        <div style="width: 100%;height: 93%;overflow: auto;">
            <div style="width: 90%;height: 40px;line-height: 40px;margin-left: 5%;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;padding-right: 1%;">
                申请详情
            </div>
            <div style="width: 100%;">
                <table style="width: 90%;margin-left: 5%;">
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            接收科室
                        </td>
                        <td id="ngks"
                            style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;"></td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            接收人
                        </td>
                        <td id="ngr"
                            style="width: 20%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;"></td>
                        <td style="width: 10%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            收文编号
                        </td>
                        <td id="gwwh"
                            style="width: 25%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;outline: none;border-top: none;"></td>
                    </tr>
                </table>
                <table style="width: 90%;margin-left: 5%;">
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            <span style="color: red;">* </span>来文单位
                        </td>
                        <td id="lwdw"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            <span style="color: red;">* </span>来文字号
                        </td>
                        <td id="lwzh"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            <span style="color: red;">* </span>收文日期
                        </td>
                        <td id="swrq"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;">
                            <input class="input-style" type="text" name="car_start" id="car_start">
                        </td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            <span style="color: red;">* </span>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题
                        </td>
                        <td id="gwbt"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            <span style="color: red;">* </span>内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容
                        </td>
                        <td id="gwnr"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            标注文本
                        </td>
                        <td id="bzwb"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            时间期限
                        </td>
                        <td id="sjqx"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注
                        </td>
                        <td id="beizhu"
                            style="width: 85%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;outline: none;"></td>
                    </tr>
                </table>
            </div>
            <div style="width: 90%;height: 40px;margin-left: 5%;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;border-top: none;padding-right: 1%;">
                审批详情
            </div>
            <div style="width: 90%;margin-left: 5%;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            医院办公室
                        </td>
                        <td id="zhuren"
                            style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                            <div id="zr_leder" style="width: 100%;height: 100px;position: relative;display: none;">
                            </div>
                        </td>
                    </tr>
                    <tr id="hq_tr" style="width: 100%;display: none;">
                        <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;"
                            id="yld_type">书记/院长
                        </td>
                        <td id="huiqian"
                            style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                            <div id="huiqian1" style="width: 100%;position: relative;display: none;">
                            </div>
                        </td>
                    </tr>
                    <tr id="fenguan_tr" style="width: 100%;">
                        <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            分管领导
                        </td>
                        <td id="fenguan"
                            style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;">
                            <div id="fg_leder" style="width: 100%;display: none;position: relative;">

                            </div>
                        </td>
                    </tr>
                    <tr id="remarks_tr" style="width: 100%;display: none;">
                        <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            备注
                        </td>
                        <td id="received_remarks"
                            style="width: 85%;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;">
                            <div id="remarks" style="width: 100%;position: relative;">

                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="fujian_div" style="width: 90%;margin-left: 5%;display: none;">
                <div style="width: 100%;height: 40px;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;border-top: none;border-bottom: none;padding-right: 1%;">
                    <span style="color: red;">* </span>附件
                    <a href="javascript:;" class="file" style="vertical-align: top;margin-top: 5px;float: right;">
                        上传附件
                        <input type="file" name="regular_main_body" id="regular_main_body"
                               onchange="upload_accessory('file1', 'regular_main', 'regular_main_body')">
                    </a>
                </div>
                <table style="width: 100%;">
                    <thead>
                    <tr>
                        <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">序号</td>
                        <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">文件名称</td>
                        <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">文件大小</td>
                        <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">上传时间</td>
                        <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">上传人员</td>
                        <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">操作</td>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="regular_main">

                    </tbody>
                </table>
            </div>
            <div id="shouyue"
                 style="width: 90%;height: 40px;margin-left: 5%;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;border-top: none;padding-right: 1%;display: none;">
                收阅详情
            </div>
            <div id="shouyue_detail" style="width: 90%;margin-left: 5%;display: none;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td style="width: 100%;border: #cccccc solid 1px;border-top: none;outline: none;padding-left: 1%;">
                            <div id="relative_div" style="width: 100%;position: relative;">

                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

    <div id="XZ" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="width: 100%;height: 15%">
            <div id="tab_4" class="shadow_tab shadow_tab_1" onclick="Change_tab(4)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/流程审批.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 id="approve_people_num" style="color: #01AAED;"></h5>
                    </div>
                    <div style="height: 25px;">审批详情</div>
                </div>
            </div>

            <div id="tab_1" class="shadow_tab_1" onclick="Change_tab(1)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/1人员管理.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 style="color: #01AAED;" id="total_number"></h5>
                    </div>
                    <div style="height: 25px;">收阅人次</div>
                </div>
            </div>

            <div id="tab_2" class="shadow_tab_1" onclick="Change_tab(2)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/查看.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 style="color: #00b7ee;" id="read_number"></h5>
                    </div>
                    <div style="height: 25px;">已查看</div>
                </div>
            </div>

            <div id="tab_3" class="shadow_tab_1" onclick="Change_tab(3)">
                <div style="width: 80px;padding-left: 10%;display: inline-block;vertical-align: top;margin-top: 15px;">
                    <img src="../../static/administrative/img/未查看.png" alt="" style="width: 50px;height: 50px;">
                </div>
                <div style="padding-left: 2%;display: inline-block;margin-top: 15px;vertical-align: top;">
                    <div style="height: 25px;">
                        <h5 style="color: #e02107;" id="unread_number"></h5>
                    </div>
                    <div style="height: 25px;">未查看</div>
                </div>
            </div>
        </div>

        <div style="width: 100%;height: 80%;margin-top: 10px;">
            <div id="tab_four" style="width: 100%;height: 100%;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 10%;">节点</th>
                        <th style="width: 10%;">审批人</th>
                        <th style="width: 20%;">审批结果</th>
                        <th style="width: 20%;">审批意见</th>
                        <th style="width: 20%;">审批时间</th>
                        <th style="width: 20%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table">
                    </tbody>
                </table>
            </div>
            <div id="tab_one" style="width: 100%;height: 100%;display: none;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 25%;">接收人</th>
                        <th style="width: 25%;">状态</th>
                        <th style="width: 25%;">收阅时间</th>
                        <th style="width: 25%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table1">
                    </tbody>
                </table>
            </div>
            <div id="tab_two" style="width: 100%;height: 100%;display: none;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 25%;">接收人</th>
                        <th style="width: 25%;">状态</th>
                        <th style="width: 25%;">收阅时间</th>
                        <th style="width: 25%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table2">
                    </tbody>
                </table>
            </div>
            <div id="tab_three" style="width: 100%;height: 100%;display: none;overflow: auto;">
                <table style="border-collapse: collapse;width: 100%;table-layout: fixed;">
                    <thead>
                    <tr>
                        <th style="width: 25%;">接收人</th>
                        <th style="width: 25%;">状态</th>
                        <th style="width: 25%;">收阅时间</th>
                        <th style="width: 25%;">签名</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="Table3">
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div id="LH" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="display: inline-block;width: 20%;vertical-align: top;height: 99%">
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                附件
            </div>
            <div id="yt_zhengwen" style="width: 100%;">

            </div>
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;display: none;">
                附件
            </div>
            <div id="yt_fujian" style="width: 100%;">

            </div>
        </div>
        <div style="display: inline-block;width: 78%;vertical-align: top;height: 99%;text-align: center;" id="fujian">
            {% if 'jpg' in file_path or 'JPG' in file_path or 'JPEG' in file_path or 'jpeg' in file_path or 'PNG' in file_path or 'png' in file_path %}
                <img src="{{ file_path }}" alt="" style="width: 800px;height: 100%;">
            {% else %}
                <embed id="embed_file" src="{{ file_path }}" type="application/pdf" style="width: 100%;height: 100%;">
            {% endif %}
        </div>
    </div>

    <div id="staff-select" class="shade" style="z-index: 11000">
        <div id="staff-model" style="width: 100%;height: 100%;position: absolute;">
            <div style="width: 900px;height: 500px;background: #F5F5F5;z-index: 11100;position: absolute;top: 50%;left: 50%;transform:translate(-50%,-50%);border-radius: 3px;border: #dfdfdf solid 1px;">
                <div id="staff-box" style="width: 100%;height: 40px;background: #f4f7fa;cursor: move;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 20%;margin-left: 1%;display: inline-block;line-height: 40px;font-size: 14px;">
                        选择人员
                    </div>
                    <span onclick="close_model()" style="float: right;padding-right: 2%;cursor: pointer;line-height: 38px;">
                        <i class="iconfont icon-quchu"></i>
                    </span>
                </div>
                <div style="height: 460px;width: 100%;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 70px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div id="dep" class="navigation navigation_color" onclick="change_navigation(this)">部门</div>
                        <div id="limits" class="navigation" onclick="change_navigation(this)">权限</div>
                        <div id="fun" class="navigation" onclick="change_navigation(this)">职能</div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;">
                            <input id="SearchDep" onkeydown="SearchDepartment()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 95%;">
                        </div>
                        <div id="SecondaryNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;">
                            <input type="checkbox" id="select-all" onclick="SelectAll(this)">
                            <input id="SearchPeo" onkeydown="SearchProple()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 87%;">
                        </div>
                        <div id="ThreeNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 410px;height: 100%;display: inline-block;vertical-align: top;overflow: auto">
                        <div style="width: 100%;height: 40px;text-align: left;font-size: 14px;line-height: 40px;">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已选 <span id="selected-number">0</span> 人
                        </div>
                        <div id="selected-div" style="width: 100%;font-size: 14px;height: 370px;overflow: auto;line-height: 20px;">

                        </div>
                        <div id="send_message" style="width: 100%;font-size: 14px;height: 40px;overflow: auto;line-height: 20px;display: none;line-height: 40px;padding-left: 3%;">
                            是否发送短信：<input type="radio" name="message" value="1"> 是<input type="radio" name="message" value="0" style="margin-left: 10px;" checked> 否
                        </div>
                        <div style="width: 100%;font-size: 14px;height: 40px;text-align: center;">
                            <button id="model-affirm" style="width: 100px;height: 30px;line-height: 25px;text-align: center;letter-spacing: 5px;border-radius: 3px;border: #cfcfcf solid 1px;font-size: 14px;cursor: pointer;margin-top: 10px;">完成</button>
                            <button onclick="close_model()" style="margin-left: 15px;width: 100px;height: 30px;line-height: 25px;text-align: center;color: #0abb78;letter-spacing: 5px;border-radius: 3px;font-size: 14px;border: #cfcfcf solid 1px;cursor: pointer;margin-top: 10px;">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}


{% block script %}
    <script language="javascript" src="../../static/personal_center/js/jquery-1.4.4.min.js"></script>
    <script language="javascript" src="../../static/personal_center/js/jquery.jqprint-0.3.js"></script>
    <script type="text/javascript" src="../../static/personal_center/js/other/jquery.js"></script>
    <script src="../../static/administrative/layDate-v5.0.9/laydate/laydate.js"></script> <!-- 改成你的路径 -->
    <script src="../../static/public_file/js/PersonnelChoosersNew.js" type="text/javascript" charset="gb2312"></script>
    <script>
        window.onload = function () {
            document.getElementById("sponsor").className = "add_class";
            document.getElementById("personage").className = "add-nav-active";
            request_fun();
        };

        var uuid = "{{ uuid | safe }}";

        function ModelLine(chose_type) {
            document.getElementById("staff-select").style.display = "table-row";
            navigation_query('1');
            document.getElementById("model-affirm").setAttribute("onclick", "summit_val('" + chose_type + "')");
            if (chose_type === 'ff') {
                document.getElementById("selected-div").style.height = '330px';
                document.getElementById("send_message").style.display = 'block';                       // 是否发送短信
                document.getElementById("model-affirm").setAttribute("onclick", "Distribution_department()");
            }
        }

        var approve_flag = "{{ approve_flag | safe }}";
        if (approve_flag) {
            document.getElementById("approve").style.display = "inline-block";
        } else {
            document.getElementById("shouyue").style.display = "inline-block";
            document.getElementById("shouyue_detail").style.display = "inline-block";
        }

        function check_dep_ff(ele_name, ele_id) {
            var processed_prople = document.getElementById("processed_prople");
            var span = document.createElement("span");
            if (!document.getElementById(ele_id).checked) {
                document.getElementById('cc-' + ele_id).remove();
            }
            if (document.getElementById(ele_id).checked) {
                span.innerText = ele_name;
                span.setAttribute("id", 'cc-' + ele_id);
                span.style.fontSize = '14px';
                span.style.marginLeft = "10px";
                processed_prople.appendChild(span);
            }
        }

        function request_fun() {
            var docement_id = window.location.href.split('id=')[1];
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('get', "/administrative/official_documents_detail_view?id=" + docement_id, true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send();
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log("JsonDate: ", JsonDate)
                        document.getElementById("ngks").innerText = JsonDate["data_dic"]["department"];
                        document.getElementById("ngr").innerText = JsonDate["data_dic"]["apply_user"];
                        document.getElementById("gwwh").innerText = JsonDate["data_dic"]["recive_number"];
                        document.getElementById("lwdw").innerText = JsonDate["data_dic"]["send_company"];
                        document.getElementById("lwzh").innerText = JsonDate["data_dic"]["send_number"];
                        document.getElementById("car_start").value = JsonDate["data_dic"]["recive_time"];
                        document.getElementById("gwbt").innerText = JsonDate["data_dic"]["title"];
                        document.getElementById("gwnr").innerText = JsonDate["data_dic"]["content"];
                        document.getElementById("bzwb").innerText = JsonDate["data_dic"]["annotated_text"];
                        document.getElementById("sjqx").innerText = JsonDate["data_dic"]["time_limit"];
                        document.getElementById("beizhu").innerText = JsonDate["data_dic"]["remarks"];

                        if (JsonDate["data_dic"]['is_stop'] === 'false') {
                            document.getElementById('is_stop').style.display = 'none';
                        }
                        if (JsonDate["data_dic"]['is_stop'] === 'false' && !approve_flag) {
                            document.getElementById('caozuo').style.display = 'none';
                        }

                        if (JsonDate["data_dic"]["node"] === "待分发" || JsonDate["data_dic"]["node"] === "科主任传阅" || JsonDate["data_dic"]["node"] === "结束") {
                            document.getElementById("print_but").style.display = "inline-block";
                        }

                        if (JsonDate["data_dic"]["type"] === "g") {
                            document.getElementById("approve").innerText = "分发";
                            document.getElementById("approve").setAttribute("onclick", "ModelLine('ff')")
                        }
                        if (JsonDate["data_dic"]["type"] === "h" && JsonDate["data_dic"]["apply_user"] === '{{ realname | safe }}') {
                            document.getElementById("fenfa").style.display = "inline-block";
                            document.getElementById("jiesu").style.display = "inline-block";
                        }

                        if (JsonDate["data_dic"]["node"] === "拒绝" && JsonDate["data_dic"]["apply_user"] === '{{ realname | safe }}') {
                            document.getElementById("car_start").value = JsonDate["data_dic"]["recive_time"] + ":00"
                            document.getElementById("fujian_div").style.display = "inline-block";
                            lay('#version').html('-v' + laydate.v);
                            laydate.render({elem: '#car_start'});
                            document.getElementById("lwdw").setAttribute("contenteditable", 'true');
                            document.getElementById("lwzh").setAttribute("contenteditable", 'true');
                            {#document.getElementById("swrq").setAttribute("contenteditable", 'true');#}
                            document.getElementById("gwbt").setAttribute("contenteditable", 'true');
                            document.getElementById("gwnr").setAttribute("contenteditable", 'true');
                            document.getElementById("bzwb").setAttribute("contenteditable", 'true');
                            document.getElementById("sjqx").setAttribute("contenteditable", 'true');
                            document.getElementById("beizhu").setAttribute("contenteditable", 'true')
                            document.getElementById("modification_button").style.display = "inline-block";
                            document.getElementById("summit_button").style.display = "none";
                            uuid = JsonDate["data_dic"]["uuid"];
                            for (var fj = 0; fj < JsonDate["data_dic"]["file_list"].length; fj++) {
                                creat_table(JsonDate["data_dic"]["file_list"][fj]);
                            }
                        }
                        if ('{{ realname | safe }}' === '管理员') {
                            document.getElementById("fujian_div").style.display = "inline-block";
                            uuid = JsonDate["data_dic"]["uuid"];
                            for (var fj = 0; fj < JsonDate["data_dic"]["file_list"].length; fj++) {
                                creat_table(JsonDate["data_dic"]["file_list"][fj]);
                            }
                        }
                        if (JsonDate["data_dic"]["node"] === "院长/书记审核") {
                            document.getElementById("sj_yz").style.display = "inline-block";
                            document.getElementById("fg_ld").style.display = "none";
                            document.getElementById("yb_zr").style.display = "none";
                            document.getElementById("model_summit").setAttribute("onclick", "shuji_yz_shenpi()");
                        }
                        if (JsonDate["data_dic"]["node"] === "分管领导签批") {
                            document.getElementById("fg_ld").style.display = "inline-block";
                            document.getElementById("sj_yz").style.display = "none";
                            document.getElementById("yb_zr").style.display = "none";
                            document.getElementById("model_summit").setAttribute("onclick", "fenguan_shenpi()");
                        }
                        if (JsonDate["data_dic"]["node"] === "申请人选择分管领导") {
                            document.getElementById("sq_people").style.display = "inline-block";
                            {#document.getElementById("sj_yz").style.display="none";#}
                            document.getElementById("yb_zr").style.display = "none";
                            document.getElementById("model_summit").setAttribute("onclick", "sq_to_fg()");
                        }

                        if (JsonDate["data_dic"]["audit_dic"].hasOwnProperty("YB")) {
                            var zhuren = document.getElementById("zr_leder");
                            for (var A = 0; A < JsonDate["data_dic"]["audit_dic"]["YB"].length; A++) {
                                if (JsonDate["data_dic"]["audit_dic"]["YB"][A]["state"] !== "待审核") {
                                    document.getElementById("zr_leder").style.display = "table";

                                    var divTag_1 = document.createElement("div");
                                    divTag_1.style.position = "relative;";
                                    divTag_1.style.width = "100%";
                                    divTag_1.style.borderBottom = "#cccccc solid 1px";
                                    var divTag_1_0 = document.createElement("div");

                                    var span_1 = document.createElement("span");
                                    span_1.innerText = JsonDate["data_dic"]["audit_dic"]["YB"][A]["state"];
                                    var span1_1 = document.createElement("span");
                                    span1_1.style.marginLeft = '3%';
                                    span1_1.innerText = JsonDate["data_dic"]["audit_dic"]["YB"][A]["audit_note"]
                                    divTag_1_0.appendChild(span_1);
                                    divTag_1_0.appendChild(span1_1);

                                    var divTag_1_1 = document.createElement("div");
                                    divTag_1_1.style.position = "absolute";
                                    divTag_1_1.style.right = "0";
                                    divTag_1_1.style.width = "300px";
                                    divTag_1_1.style.textAlign = "right";
                                    divTag_1_1.style.color = "#0b0b0b";
                                    divTag_1_1.style.lineHeight = "0px";
                                    divTag_1_1.innerText = JsonDate["data_dic"]["audit_dic"]["YB"][A]["audit_time"];
                                    var divTag_1_2 = document.createElement("div");
                                    divTag_1_2.innerHTML = "<img style='width: 150px;height: 60px;' src='" + JsonDate["data_dic"]["audit_dic"]["YB"][A]["signature_picture"] + "'>"
                                    divTag_1.appendChild(divTag_1_0);
                                    divTag_1.appendChild(divTag_1_2);
                                    divTag_1.appendChild(divTag_1_1);
                                    zhuren.appendChild(divTag_1);
                                }
                            }
                        }
                        if (JsonDate["data_dic"]["audit_dic"].hasOwnProperty("YZ/SJ")) {
                            document.getElementById("hq_tr").style.display = "table-row";
                            var huiqian = document.getElementById("huiqian1");
                            for (var hq = 0; hq < JsonDate["data_dic"]["audit_dic"]["YZ/SJ"].length; hq++) {
                                if (JsonDate["data_dic"]["audit_dic"]["YZ/SJ"][hq]["state"] !== "待审核") {
                                    huiqian.style.display = "table";
                                    var hq_divTag = document.createElement("div");
                                    hq_divTag.style.position = "relative;";
                                    hq_divTag.style.width = "100%";
                                    hq_divTag.style.height = "100px";
                                    hq_divTag.style.borderBottom = "#cccccc solid 1px";
                                    var hq_div_tag_0 = document.createElement("div");
                                    hq_div_tag_0.innerHTML = "<span>" + JsonDate["data_dic"]["audit_dic"]["YZ/SJ"][hq]["state"] + "</span><span style='margin-left: 3%;'>" + JsonDate["data_dic"]["audit_dic"]["YZ/SJ"][hq]["audit_note"] + "</span>";
                                    var hq_div_tag_1 = document.createElement("div");
                                    hq_div_tag_1.style.position = "absolute";
                                    hq_div_tag_1.style.right = "0";
                                    hq_div_tag_1.style.width = "300px";
                                    hq_div_tag_1.style.textAlign = "right";
                                    hq_div_tag_1.style.color = "#0b0b0b";
                                    hq_div_tag_1.style.lineHeight = "0px";
                                    hq_div_tag_1.innerText = JsonDate["data_dic"]["audit_dic"]["YZ/SJ"][hq]["audit_time"];
                                    var hq_div_tag_2 = document.createElement("div");
                                    hq_div_tag_2.innerHTML = "<img style='width: 150px;height: 60px;' src='" + JsonDate["data_dic"]["audit_dic"]["YZ/SJ"][hq]["signature_picture"] + "'>"
                                    hq_divTag.appendChild(hq_div_tag_0);
                                    hq_divTag.appendChild(hq_div_tag_2);
                                    hq_divTag.appendChild(hq_div_tag_1);
                                    huiqian.appendChild(hq_divTag);
                                }
                            }
                        }

                        if (JsonDate["data_dic"]["audit_dic"].hasOwnProperty("B")) {
                            var hq_leder = document.getElementById("fg_leder");
                            for (var Y = 0; Y < JsonDate["data_dic"]["audit_dic"]["B"].length; Y++) {
                                if (JsonDate["data_dic"]["audit_dic"]["B"][Y]["state"] !== "待审核") {
                                    hq_leder.style.display = "table";
                                    var divTag = document.createElement("div");
                                    divTag.style.position = "relative;";
                                    divTag.style.width = "100%";
                                    divTag.style.borderBottom = "#cccccc solid 1px";
                                    var div_tag_0 = document.createElement("div");

                                    var span = document.createElement("span");
                                    span.innerText = JsonDate["data_dic"]["audit_dic"]["B"][Y]["state"];
                                    var span1 = document.createElement("span");
                                    span1.style.marginLeft = '3%';
                                    span1.innerText = JsonDate["data_dic"]["audit_dic"]["B"][Y]["audit_note"]
                                    div_tag_0.appendChild(span);
                                    div_tag_0.appendChild(span1);

                                    var div_tag_1 = document.createElement("div");
                                    div_tag_1.style.position = "absolute";
                                    div_tag_1.style.right = "0";
                                    div_tag_1.style.width = "300px";
                                    div_tag_1.style.textAlign = "right";
                                    div_tag_1.style.color = "#0b0b0b";
                                    div_tag_1.style.lineHeight = "0px";
                                    div_tag_1.innerText = JsonDate["data_dic"]["audit_dic"]["B"][Y]["audit_time"];
                                    var div_tag_2 = document.createElement("div");
                                    div_tag_2.innerHTML = "<img style='width: 150px;height: 60px;' src='" + JsonDate["data_dic"]["audit_dic"]["B"][Y]["signature_picture"] + "'>"
                                    divTag.appendChild(div_tag_0);
                                    divTag.appendChild(div_tag_2);
                                    divTag.appendChild(div_tag_1);
                                    hq_leder.appendChild(divTag);
                                }
                            }
                        } else {
                            document.getElementById("fenguan_tr").style.display = 'none';
                        }

                        if (JsonDate["data_dic"]["audit_dic"].hasOwnProperty("remarks")) {
                            if (JsonDate["data_dic"]["flag"]) {
                                var remarks = document.getElementById("remarks");
                                for (var G = 0; G < JsonDate["data_dic"]["audit_dic"]["remarks"].length; G++) {
                                    if (JsonDate["data_dic"]["audit_dic"]["remarks"][G]["state"] !== "待审核") {
                                        document.getElementById("remarks_tr").style.display = "table-row";
                                        var remarks_divTag = document.createElement("div");
                                        remarks_divTag.style.position = "relative;";
                                        remarks_divTag.style.width = "100%";
                                        remarks_divTag.style.borderBottom = "#cccccc solid 1px";
                                        var remarks_div_tag_0 = document.createElement("div");

                                        var remarks_span1 = document.createElement("span");
                                        remarks_span1.style.marginLeft = '3%';
                                        remarks_span1.innerText = JsonDate["data_dic"]["audit_dic"]["remarks"][G]["audit_note"]
                                        remarks_div_tag_0.appendChild(remarks_span1);

                                        var remarks_div_tag_1 = document.createElement("div");
                                        remarks_div_tag_1.style.position = "absolute";
                                        remarks_div_tag_1.style.right = "0";
                                        remarks_div_tag_1.style.width = "300px";
                                        remarks_div_tag_1.style.textAlign = "right";
                                        remarks_div_tag_1.style.color = "#0b0b0b";
                                        remarks_div_tag_1.style.lineHeight = "0px";
                                        remarks_div_tag_1.style.bottom = "10px";
                                        remarks_div_tag_1.innerText = JsonDate["data_dic"]["audit_dic"]["remarks"][G]["audit_time"];
                                        var remarks_div_tag_2 = document.createElement("div");
                                        remarks_div_tag_2.innerHTML = "<img style='width: 150px;height: 60px;' src='" + JsonDate["data_dic"]["audit_dic"]["remarks"][G]["signature_picture"] + "'>"
                                        remarks_divTag.appendChild(remarks_div_tag_0);
                                        remarks_divTag.appendChild(remarks_div_tag_2);
                                        remarks_divTag.appendChild(remarks_div_tag_1);
                                        remarks.appendChild(remarks_divTag);
                                    }
                                }
                            }
                        }

                        if (JsonDate["data_dic"]['file_list'].length) {
                            document.getElementById("embed_file").setAttribute("src", JsonDate["data_dic"]['file_list'][0]["file_path"].replace("mediaTopics", "/media/Topics"));
                        }

                        var yt_zhengwen = document.getElementById("yt_zhengwen");
                        var dowload_ul = document.getElementById("dowload_ul");
                        for (var d = 0; d < JsonDate["data_dic"]['file_list'].length; d++) {
                            var div_tag = document.createElement("div");
                            div_tag.style.width = "100%";
                            div_tag.style.height = "40px";
                            div_tag.style.lineHeight = "40px";
                            var a_tag = document.createElement("a");
                            a_tag.setAttribute("href", "#");
                            a_tag.className = "a_tag_cla";
                            a_tag.innerText = JsonDate["data_dic"]['file_list'][d]["file_name"];
                            a_tag.setAttribute("onclick", "chage_yulan(this, '" + JsonDate["data_dic"]['file_list'][d]["file_path"].replace("mediaTopics", "/media/Topics") + "')");
                            div_tag.appendChild(a_tag);
                            yt_zhengwen.appendChild(div_tag);
                            var li = document.createElement("li");
                            li.innerHTML = "<a style='color: black;font-size: 14px;' href='http://" + local_host + "/announcements/file_download?file_path=" + JsonDate["data_dic"]['file_list'][d]["word_path"] + "'>" + JsonDate["data_dic"]['file_list'][d]["file_name"] + "</a>";
                            dowload_ul.appendChild(li);
                        }

                        var yt_fujian = document.getElementById("yt_fujian");
                        for (var e = 0; e < JsonDate["data_dic"]['file_list1'].length; e++) {
                            var div_tag1 = document.createElement("div");
                            div_tag1.style.width = "100%";
                            div_tag1.style.height = "40px";
                            div_tag1.style.lineHeight = "40px";
                            var a_tag1 = document.createElement("a");
                            a_tag1.setAttribute("href", "#");
                            a_tag1.className = "a_tag_cla";
                            a_tag1.innerText = JsonDate["data_dic"]['file_list1'][e]["file_name"];
                            a_tag1.setAttribute("onclick", "chage_yulan(this, '" + JsonDate["data_dic"]['file_list1'][e]["file_path"].replace("mediaTopics", "/media/Topics") + "')");
                            div_tag1.appendChild(a_tag1);
                            yt_fujian.appendChild(div_tag1);
                        }

                        CreateMyMine(JsonDate["data_dic"]["audit_dic"]);
                        if (!JsonDate["data_dic"]["recive_people"].length) {
                            document.getElementById("unread_number").innerText = "0 人";
                            document.getElementById("read_number").innerText = "0 人";
                            document.getElementById("total_number").innerText = "0 人";
                        } else {
                            create_recive_people(JsonDate["data_dic"]["recive_people"]);
                        }
                    }
                }
            }
        }

        // 上传正文
        function upload_accessory(file_type, tbody_id, accessory_type, bh_id) {
            document.getElementById("loading").style.display = "inline-block";
            var bill_id = window.location.href.split('id=')[1].replace("#", '')
            var form = new FormData();
            var files = document.getElementById(accessory_type).files[0];
            form.append(file_type, files);
            form.append('number', uuid);
            form.append('source', "lw");
            form.append('bill_id', bill_id);

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/topics_attachments_upload", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        if (JsonDate["code"] === 400) {
                            alert("请上传xlsx格式文件！")
                        }
                        creat_table(JsonDate, tbody_id)
                    }
                }
            };
        }

        function summit_fun() {
            var swbh = document.getElementById("gwwh").innerText;           // 收文编号
            var lwdw = document.getElementById("lwdw").innerText;           // 来文单位
            var lwzh = document.getElementById("lwzh").innerText;           // 来文字号
            var swrq = document.getElementById("car_start").value;          // 收文日期
            var gwbt = document.getElementById("gwbt").innerText;           // 收文标题
            var gwnr = document.getElementById("gwnr").innerText;           // 收文内容
            var bzwb = document.getElementById("bzwb").innerText;           // 标注文本
            var sjqx = document.getElementById("sjqx").innerText;           // 时间期限
            var beizhu = document.getElementById("beizhu").innerText;       // 来文备注

            if (!lwdw) {
                alert("来文单位不能为空！")
                return false
            } else if (!lwzh) {
                alert("来文字号不能为空！")
                return false
            } else if (!swrq) {
                alert("收文日期不能为空！")
                return false
            } else if (!gwbt) {
                alert("标题不能为空！")
                return false
            } else if (!gwnr) {
                alert("内容不能为空！")
                return false
            }
            var t_table = document.getElementById('regular_main').childNodes.length;
            if (t_table === 0) {
                alert("请上传正文！")
                return false
            }

            document.getElementById("loading").style.display = "inline-block";
            var send_str = "send_number=" + String(lwzh) + "&recive_number=" + swbh + "&send_company=" + lwdw + "&recive_time=" + swrq + "&title=" + gwbt + "&content=" + gwnr + "&annotated_text=" + bzwb + "&time_limit=" + sjqx + "&uuid=" + uuid + "&rake_up=ture" + "&beizhu=" + beizhu;
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/official_documents_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send(send_str);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("修改成功！")
                        window.location.href = 'superiorJeremy.html';
                        document.getElementById("XZ").style.display = "inline-block";
                        document.getElementById("XZ_tag").className = "tab_top top_tag";
                        document.getElementById("DW_tag").className = "tab_top";
                        document.getElementById("DW").style.display = "none";
                    }
                }
            };
        }

        // 创建附件列表
        function creat_table(JsonData) {
            var t_table = document.getElementById("regular_main");
            var local_host = window.location.host;
            if (Array.isArray(JsonData["pdf_path"])) {
                for (var i = 0; i < JsonData["pdf_path"].length; i++) {
                    var tr = document.createElement("tr");var td1 = document.createElement("td");var td2 = document.createElement("td");var td3 = document.createElement("td");var td4 = document.createElement("td");var td5 = document.createElement("td");var td6 = document.createElement("td");
                    td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                    td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                    td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                    td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                    td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                    td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"][i]["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["pdf_path"][i]["id"] + "\")'>删除</a>";
                    td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";td6.style.borderTop = "none";
                    tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
                    t_table.appendChild(tr);
                }
                if (JsonData["pdf_path"].length > 1) {
                    document.getElementById("del_adjunct").style.display = 'block';
                }
            } else {
                tr = document.createElement("tr");td1 = document.createElement("td");td2 = document.createElement("td");td3 = document.createElement("td");td4 = document.createElement("td");td5 = document.createElement("td");td6 = document.createElement("td");
                td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"regular_main\", \"" + JsonData["id"] + "\")'>删除</a>";
                td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";td6.style.borderTop = "none";
                tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);t_table.appendChild(tr);
            }
        }

        function RemoveTr(_this, tbody_id, wj_id) {
            var table = document.getElementById(tbody_id);
            var trNode = $(_this).parent().parent();
            trNode.remove();

            for (var i = 0; i < table.children.length; i++) {
                table.children[i].children[0].innerHTML = i + 1;
            }

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/delete_attachments_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id=" + String(wj_id));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("删除成功！")
                    }
                }
            };
        }

        function show_model() {
            document.getElementById("addForm").style.display = "table-row";
        }

        function close_models1() {
            document.getElementById("addForm").style.display = "none";
        }

        let title1 = document.querySelector("#title");
        let addForm2 = document.querySelector("#addForm2");

        title1.addEventListener("mousedown", function (e) {
            let x = e.pageX - addForm2.offsetLeft;
            let y = e.pageY - addForm2.offsetTop;

            document.addEventListener("mousemove", move);

            function move(e) {
                addForm2.style.left = e.pageX - x + 'px';
                addForm2.style.top = e.pageY - y + 'px';
            }

            document.addEventListener("mouseup", function (e) {
                document.removeEventListener("mousemove", move);
            })
        });

        function CreateMyMine(json_data) {
            if (json_data.length === 0) {
                document.getElementById("img-display").style.display = "inline-block";
            }
            deltr();
            var my_mine_body = document.getElementById("Table");
            var approve_number = 0;
            if (json_data.hasOwnProperty("YB")) {
                for (var A = 0; A < json_data["YB"].length; A++) {
                    var tr_mine = document.createElement("tr");
                    var TdMind = document.createElement("td");
                    var TdMind1 = document.createElement("td");
                    var TdMind2 = document.createElement("td");
                    var TdMind3 = document.createElement("td");
                    var TdMind4 = document.createElement("td");
                    var TdMind5 = document.createElement("td");
                    TdMind.innerHTML = "院办主任";
                    TdMind.style.textAlign = "center";
                    TdMind1.innerHTML = json_data["YB"][A]["audit_user"];
                    TdMind1.style.textAlign = "center";
                    TdMind2.innerHTML = json_data["YB"][A]["state"];
                    TdMind2.style.textAlign = "center";
                    TdMind3.innerHTML = json_data["YB"][A]["audit_note"];
                    TdMind3.style.textAlign = "center";
                    TdMind4.innerHTML = json_data["YB"][A]["audit_time"];
                    TdMind4.style.textAlign = "center";
                    if (json_data["YB"][A]["signature_picture"]) {
                        TdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["YB"][A]["signature_picture"] + "'>";
                        TdMind5.style.textAlign = "center";
                    } else {
                        TdMind5.innerHTML = "";
                        TdMind5.style.textAlign = "center";
                    }
                    approve_number += 1;
                    tr_mine.appendChild(TdMind);
                    tr_mine.appendChild(TdMind1);
                    tr_mine.appendChild(TdMind2);
                    tr_mine.appendChild(TdMind3);
                    tr_mine.appendChild(TdMind4);
                    tr_mine.appendChild(TdMind5);
                    my_mine_body.appendChild(tr_mine);
                }
            }

            if (json_data.hasOwnProperty("YZ/SJ")) {
                for (var B = 0; B < json_data["YZ/SJ"].length; B++) {
                    var fg_mine = document.createElement("tr");
                    var fg_TdMind = document.createElement("td");
                    var fg_TdMind1 = document.createElement("td");
                    var fg_TdMind2 = document.createElement("td");
                    var fg_TdMind3 = document.createElement("td");
                    var fg_TdMind4 = document.createElement("td");
                    var fg_TdMind5 = document.createElement("td");
                    fg_TdMind.innerHTML = "书记/院长";
                    fg_TdMind.style.textAlign = "center";
                    fg_TdMind1.innerHTML = json_data["YZ/SJ"][B]["audit_user"];
                    fg_TdMind1.style.textAlign = "center";
                    fg_TdMind2.innerHTML = json_data["YZ/SJ"][B]["state"];
                    fg_TdMind2.style.textAlign = "center";
                    fg_TdMind3.innerHTML = json_data["YZ/SJ"][B]["audit_note"];
                    fg_TdMind3.style.textAlign = "center";
                    fg_TdMind4.innerHTML = json_data["YZ/SJ"][B]["audit_time"];
                    fg_TdMind4.style.textAlign = "center";
                    if (json_data["YZ/SJ"][B]["signature_picture"]) {
                        fg_TdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["YZ/SJ"][B]["signature_picture"] + "'>";
                        fg_TdMind5.style.textAlign = "center";
                    } else {
                        fg_TdMind5.innerHTML = "";
                        fg_TdMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    fg_mine.appendChild(fg_TdMind);
                    fg_mine.appendChild(fg_TdMind1);
                    fg_mine.appendChild(fg_TdMind2);
                    fg_mine.appendChild(fg_TdMind3);
                    fg_mine.appendChild(fg_TdMind4);
                    fg_mine.appendChild(fg_TdMind5);
                    my_mine_body.appendChild(fg_mine);
                }

            }

            if (json_data.hasOwnProperty("B")) {
                for (var C = 0; C < json_data["B"].length; C++) {
                    var HQ_mine = document.createElement("tr");
                    var HQ_TdMind = document.createElement("td");
                    var HQ_TdMind1 = document.createElement("td");
                    var HQ_TdMind2 = document.createElement("td");
                    var HQ_TdMind3 = document.createElement("td");
                    var HQ_TdMind4 = document.createElement("td");
                    var HQ_TdMind5 = document.createElement("td");
                    HQ_TdMind.innerHTML = "分管领导";
                    HQ_TdMind.style.textAlign = "center";
                    HQ_TdMind1.innerHTML = json_data["B"][C]["audit_user"];
                    HQ_TdMind1.style.textAlign = "center";
                    HQ_TdMind2.innerHTML = json_data["B"][C]["state"];
                    HQ_TdMind2.style.textAlign = "center";
                    HQ_TdMind3.innerHTML = json_data["B"][C]["audit_note"];
                    HQ_TdMind3.style.textAlign = "center";
                    HQ_TdMind4.innerHTML = json_data["B"][C]["audit_time"];
                    HQ_TdMind4.style.textAlign = "center";
                    if (json_data["B"][C]["signature_picture"]) {
                        HQ_TdMind5.innerHTML = "<img style='width: 100px;height: 40px;' src='" + json_data["B"][C]["signature_picture"] + "'>";
                        HQ_TdMind5.style.textAlign = "center";
                    } else {
                        HQ_TdMind5.innerHTML = "";
                        HQ_TdMind5.style.textAlign = "center";
                    }
                    approve_number += 1
                    HQ_mine.appendChild(HQ_TdMind);
                    HQ_mine.appendChild(HQ_TdMind1);
                    HQ_mine.appendChild(HQ_TdMind2);
                    HQ_mine.appendChild(HQ_TdMind3);
                    HQ_mine.appendChild(HQ_TdMind4);
                    HQ_mine.appendChild(HQ_TdMind5);
                    my_mine_body.appendChild(HQ_mine);
                }

            }
            document.getElementById("approve_people_num").innerText = String(approve_number) + " 人";
        }

        function create_recive_people(jsonData) {
            var total_number = 0;
            var read_number = 0;
            var unread_number = 0;
            var Table1 = document.getElementById("Table1");
            var Table2 = document.getElementById("Table2");
            var Table3 = document.getElementById("Table3");
            var relative_div = document.getElementById("relative_div");
            for (var i = 0; i < jsonData.length; i++) {
                if (jsonData[i]["state"] === "未读") {
                    unread_number += 1;
                    no_recive(jsonData[i], Table3)
                } else {
                    read_number += 1
                    recive_people(jsonData[i], Table2);
                    attention_func(jsonData[i], relative_div);
                }
                total_number += 1
                document.getElementById("unread_number").innerText = String(unread_number) + " 人";
                document.getElementById("read_number").innerText = String(read_number) + " 人";
                document.getElementById("total_number").innerText = String(total_number) + " 人";
                all_recive(jsonData[i], Table1)
            }
        }

        // 所有收阅人
        function all_recive(recive_data, Table) {
            var tr = document.createElement("tr");
            var td = document.createElement("td");
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            td.innerHTML = recive_data["user"];
            td.style.textAlign = "center";
            td1.style.textAlign = "center";
            td3.style.textAlign = "center";
            if (recive_data["state"] === "未读") {
                td1.innerHTML = "未收阅";
            } else {
                td1.innerHTML = "已收阅";
            }
            td2.innerHTML = recive_data["update_time"];
            td2.style.textAlign = "center";
            if (!recive_data["signature_picture"] && recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["user"];
            } else if (recive_data["state"] !== "未读") {
                td3.innerHTML = "<img src='" + recive_data["signature_picture"] + "' style='width: 100px;height: 40px;'>";
            }
            tr.appendChild(td);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            Table.appendChild(tr);
        }

        // 已收阅
        function recive_people(recive_data, Table) {
            var tr = document.createElement("tr");
            var td = document.createElement("td");
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            td.innerHTML = recive_data["user"];
            td.style.textAlign = "center";
            td1.style.textAlign = "center";
            td3.style.textAlign = "center";
            td1.innerHTML = "已收阅";
            td2.innerHTML = recive_data["update_time"];
            td2.style.textAlign = "center";
            if (!recive_data["signature_picture"] && recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["user"];
            } else if (recive_data["state"] !== "未读") {
                td3.innerHTML = "<img src='" + recive_data["signature_picture"] + "' style='width: 100px;height: 40px;'>";
            }
            tr.appendChild(td);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            Table.appendChild(tr);
        }

        // 未收阅
        function no_recive(recive_data, Table) {
            var tr = document.createElement("tr");
            var td = document.createElement("td");
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            td.innerHTML = recive_data["user"];
            td.style.textAlign = "center";
            td1.style.textAlign = "center";
            td3.style.textAlign = "center";
            td1.innerHTML = "未收阅";
            td2.innerHTML = recive_data["update_time"];
            td2.style.textAlign = "center";
            if (recive_data["signature_picture"] === "/media/") {
                td3.innerHTML = recive_data["user"];
            } else if (recive_data["state"] !== "未读") {
                td3.innerHTML = recive_data["signature_picture"];
            }
            tr.appendChild(td);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            Table.appendChild(tr);
        }

        // 删除列表
        function deltr() {
            var tb = document.getElementById('Table');
            var rowNum = tb.rows.length;
            for (i = 0; i < rowNum; i++) {
                tb.deleteRow(i);
                rowNum = rowNum - 1;
                i = i - 1;
            }
        }

        function chage_yulan(this_, file_path) {
            var fujian = document.getElementById("fujian");
            var file_index = file_path.lastIndexOf(".")
            var ext = file_path.substring(file_index + 1)
            var arr = ['jpg', 'JPG', "JPEG", "jpeg", "PNG", "png"];
            var ext_index = arr.indexOf(ext);
            if (ext_index === -1) {
                fujian.innerHTML = '<embed id="embed_file" src="' + file_path + '" type="" style="width: 100%;height: 100%;">'
            } else {
                fujian.innerHTML = '<img src="' + file_path + '" alt="application/pdf" style="width: 800px;height: 100%;">'
            }

            var a_tag_list = document.getElementsByClassName("a_tag_cla");
            for (var i = 0; i < a_tag_list.length; i++) {
                a_tag_list[i].style.background = '';
            }
            this_.style.background = '#cfcfcf';
        }

        function change_mind(ele_id) {
            if (ele_id === "DW") {
                document.getElementById("DW").style.display = "inline-block";
                document.getElementById("DW_tag").className = "tab_top top_tag";
                document.getElementById("XZ_tag").className = "tab_top";
                document.getElementById("XZ").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
                document.getElementById("dowload_but").style.display = "none";
            } else if (ele_id === "XZ") {
                document.getElementById("XZ").style.display = "inline-block";
                document.getElementById("XZ_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
                document.getElementById("dowload_but").style.display = "none";
            } else {
                document.getElementById("LH").style.display = "inline-block";
                document.getElementById("LH_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("XZ_tag").className = "tab_top";
                document.getElementById("XZ").style.display = "none";
                document.getElementById("dowload_but").style.display = "inline-block";
            }
        }

        function online_tag() {
            document.getElementById("new_models").style.display = "table-row";
        }

        function close_models() {
            document.getElementById("new_models").style.display = "none";
        }

        function summit_data() {
            var present_id = window.location.href.split("id=")[1].replace("#", '');
            var approve = $("input[type=radio][name=lwgd]:checked").val();
            var opinion_detail_zr = '';
            var shenpi_people = document.getElementById("zr_xz").value;
            if (!approve) {
                alert("请选择下一步流程！");
                return false
            }
            if (approve === 'b') {
                opinion_detail_zr = document.getElementById("opinion_detail_zr").value;
                if (!opinion_detail_zr) {
                    alert("请填写审批意见！");
                    return false
                }
                if (!shenpi_people) {
                    alert("请选择审批人！");
                    return false
                }
            } else if (approve === 'c') {
                opinion_detail_zr = document.getElementById("sj_opinion").value;
                if (!opinion_detail_zr) {
                    alert("请填写审批意见！");
                    return false
                }
            } else if (approve === 'g') {
                opinion_detail_zr = document.getElementById("zr_ff_option").value;
                shenpi_people = document.getElementById("zr_ff").value;
            } else if (approve === 'd') {
                opinion_detail_zr = document.getElementById("yz_opinion").value;
                if (!opinion_detail_zr) {
                    alert("请填写审批意见！");
                    return false
                }
            } else if (approve === 'f') {
                opinion_detail_zr = document.getElementById("send_back").value;
                if (!opinion_detail_zr) {
                    alert("请填写审批意见！");
                    return false
                }
            } else if (approve === 'e') {
                opinion_detail_zr = document.getElementById("sy_opinion").value;
                if (!opinion_detail_zr) {
                    alert("请填写审批意见！");
                    return false
                }
            }
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/official_documents_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&type=" + String(approve) + "&audit_note=" + String(opinion_detail_zr) + "&fg_people=" + String(shenpi_people));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("审批成功");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        function shuji_yz_shenpi() {
            var present_id = window.location.href.split("id=")[1].replace("#", '');
            var audit_result = $("input[type=radio][name=check]:checked").val();
            var opinion_detail_sj_yz = document.getElementById("opinion_detail_sj_yz").value;

            if (audit_result === "draft") {
                if (!opinion_detail_sj_yz) {
                    alert("请填写审批意见！");
                    return false
                }
            }
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/official_documents_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&audit_note=" + String(opinion_detail_sj_yz) + "&state=" + String(audit_result));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("审批成功");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        function fenguan_shenpi() {
            var present_id = window.location.href.split("id=")[1].replace("#", '');
            var opinion_detail_fg = document.getElementById("opinion_detail_fg").value;
            var audit_result = $("input[type=radio][name=check1]:checked").val();
            if (!opinion_detail_fg) {
                alert("请填写审批意见！");
                return false
            }

            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/official_documents_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&audit_note=" + String(opinion_detail_fg) + "&state=" + String(audit_result));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("审批成功");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        function sq_to_fg() {
            var present_id = window.location.href.split("id=")[1].replace("#", '');
            var shenpi_people = document.getElementById("ld_xz").value;
            if (!shenpi_people) {
                alert("请选择分管人员！");
                return false
            }
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP               +"&fg_people="+String(shenpi_people)
            xhr.open('post', "/administrative/official_documents_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + present_id + "&fg_people=" + String(shenpi_people));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("审批成功");
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }


        // 删除列表
        function deltr1() {
            var tb = document.getElementById('t_table2');
            var rowNum = tb.rows.length;
            for (i = 0; i < rowNum; i++) {
                tb.deleteRow(i);
                rowNum = rowNum - 1;
                i = i - 1;
            }
        }

        function summit_val(chose_type) {
            var prople_list = [];
            var selected_personnel_list = document.getElementsByClassName('selected-personnel');
            for (var i=0; i<selected_personnel_list.length; i++) {
                prople_list.push(selected_personnel_list[i].innerText)
            }
            var ExecutorPeople = prople_list.join();
            document.getElementById(chose_type).value = ExecutorPeople;
            close_model();
        }

        function Change_tab(change_number) {
            if (change_number === 1) {
                document.getElementById("tab_1").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab_1";
                document.getElementById("tab_one").style.display = "inline-block";
                document.getElementById("tab_two").style.display = "none";
                document.getElementById("tab_three").style.display = "none";
                document.getElementById("tab_4").className = "shadow_tab_1";
                document.getElementById("tab_four").style.display = "none";
            } else if (change_number === 2) {
                document.getElementById("tab_1").className = "shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab_1";
                document.getElementById("tab_two").style.display = "inline-block";
                document.getElementById("tab_one").style.display = "none";
                document.getElementById("tab_three").style.display = "none";
                document.getElementById("tab_4").className = "shadow_tab_1";
                document.getElementById("tab_four").style.display = "none";
            } else if (change_number === 3) {
                document.getElementById("tab_1").className = "shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_three").style.display = "inline-block";
                document.getElementById("tab_two").style.display = "none";
                document.getElementById("tab_one").style.display = "none";
                document.getElementById("tab_4").className = "shadow_tab_1";
                document.getElementById("tab_four").style.display = "none";
            } else {
                document.getElementById("tab_1").className = "shadow_tab_1";
                document.getElementById("tab_2").className = "shadow_tab_1";
                document.getElementById("tab_3").className = "shadow_tab_1";
                document.getElementById("tab_4").className = "shadow_tab shadow_tab_1";
                document.getElementById("tab_four").style.display = "inline-block";
                document.getElementById("tab_two").style.display = "none";
                document.getElementById("tab_one").style.display = "none";
                document.getElementById("tab_three").style.display = "none";
            }
        }

        // 收阅详情
        function attention_func(dict_data, relative_div) {
            var divTag = document.createElement("div");
            divTag.style.position = "relative;";
            divTag.style.width = "100%";
            divTag.style.height = "80px";
            divTag.style.borderBottom = "#cccccc solid 1px";
            var div_tag_0 = document.createElement("div");
            div_tag_0.innerHTML = "<span>已收阅</span>";
            var div_tag_1 = document.createElement("div");
            div_tag_1.style.position = "absolute";
            div_tag_1.style.right = "0";
            div_tag_1.style.width = "300px";
            div_tag_1.style.textAlign = "right";
            div_tag_1.style.color = "#0b0b0b";
            div_tag_1.style.lineHeight = "0px";
            div_tag_1.innerText = dict_data["update_time"];
            var div_tag_2 = document.createElement("div");
            if (dict_data["signature_picture"]) {
                div_tag_2.innerHTML = "<img style='width: 100px;height: 40px;' src='" + dict_data["signature_picture"] + "'>"
            } else {
                div_tag_2.innerHTML = dict_data["user"]
            }
            divTag.appendChild(div_tag_0);
            divTag.appendChild(div_tag_2);
            divTag.appendChild(div_tag_1);
            relative_div.appendChild(divTag);
        }

        function please_find_opinion(eve_name) {
            if (eve_name === 'b') {
                document.getElementById("PleaseFindOpinion").style.display = "inline-block";
                document.getElementById("yz_return_opinion").style.display = "none";
                document.getElementById("sj_return_opinion").style.display = "none";
                document.getElementById("return_opinion").style.display = "none";
                document.getElementById("sy_return_opinion").style.display = "none";
                document.getElementById("DirectorDistribution").style.display = "none";
            } else if (eve_name === 'f') {
                document.getElementById("return_opinion").style.display = "inline-block";
                document.getElementById("yz_return_opinion").style.display = "none";
                document.getElementById("sj_return_opinion").style.display = "none";
                document.getElementById("PleaseFindOpinion").style.display = "none";
                document.getElementById("sy_return_opinion").style.display = "none";
                document.getElementById("DirectorDistribution").style.display = "none";
            } else if (eve_name === 'c') {
                document.getElementById("sj_return_opinion").style.display = "inline-block";
                document.getElementById("yz_return_opinion").style.display = "none";
                document.getElementById("PleaseFindOpinion").style.display = "none";
                document.getElementById("return_opinion").style.display = "none";
                document.getElementById("sy_return_opinion").style.display = "none";
                document.getElementById("DirectorDistribution").style.display = "none";
            } else if (eve_name === 'd') {
                document.getElementById("yz_return_opinion").style.display = "inline-block";
                document.getElementById("sj_return_opinion").style.display = "none";
                document.getElementById("PleaseFindOpinion").style.display = "none";
                document.getElementById("return_opinion").style.display = "none";
                document.getElementById("sy_return_opinion").style.display = "none";
                document.getElementById("DirectorDistribution").style.display = "none";
            } else if (eve_name === 'e') {
                document.getElementById("sy_return_opinion").style.display = "inline-block";
                document.getElementById("yz_return_opinion").style.display = "none";
                document.getElementById("sj_return_opinion").style.display = "none";
                document.getElementById("PleaseFindOpinion").style.display = "none";
                document.getElementById("return_opinion").style.display = "none";
                document.getElementById("DirectorDistribution").style.display = "none";
            } else if (eve_name === 'g') {
                document.getElementById("DirectorDistribution").style.display = "inline-block";
                document.getElementById("sy_return_opinion").style.display = "none";
                document.getElementById("yz_return_opinion").style.display = "none";
                document.getElementById("sj_return_opinion").style.display = "none";
                document.getElementById("PleaseFindOpinion").style.display = "none";
                document.getElementById("return_opinion").style.display = "none";
            } else {
                document.getElementById("PleaseFindOpinion").style.display = "none";
                document.getElementById("return_opinion").style.display = "none";
                document.getElementById("yz_return_opinion").style.display = "none";
                document.getElementById("sj_return_opinion").style.display = "none";
                document.getElementById("sy_return_opinion").style.display = "none";
                document.getElementById("DirectorDistribution").style.display = "none";
            }
        }

        var company_list = {{ company_list | safe }};


        function Distribution_department() {
            var xhr = new XMLHttpRequest();
            var document_id = window.location.href.split("id=")[1].replace("#", '');
            var prople_list = [];
            var selected_personnel_list = document.getElementsByClassName('selected-personnel');
            for (var i=0; i<selected_personnel_list.length; i++) {
                prople_list.push(selected_personnel_list[i].innerText)
            }
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/official_documents_receive");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            var message = $("input[type=radio][name=message]:checked").val();
            xhr.send("id=" + String(document_id) + "&receive_people=" + prople_list.join() + "&message=" + message);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        alert("分发成功！")
                        console.log(JsonDate);
                        window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                    }
                }
            };
        }

        function disp_peo(types) {
            if (types === 1) {
                document.getElementById("peoples_check").style.display = "inline-block";
            }
            if (types === 2) {
                document.getElementById("peoples_check").style.display = "none";
            }
        }

        function but_click() {
            document.getElementById("loading").style.display = "inline-block";
            var docement_id = window.location.href.split('id=')[1];
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/personal-center/ask_preview");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send("id=" + docement_id);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate)
                        window.open(JsonDate["data"][0]["file_path"]);
                    }
                }
            };
        }

        function do_finish() {
            var r = confirm("是否结束？")
            if (r === true) {
                var id = window.location.href.split("id=")[1].replace("#", '');
                var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/administrative/official_documents_finish_view", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("id=" + String(id));
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            var JsonDate = JSON.parse(xhr.responseText);
                            if (JsonDate['code'] === 200) {
                                console.log('JsonDate', JsonDate)
                                alert('结束成功')
                                window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=";
                            } else {
                                alert(JsonDate['message'])
                                window.location.reload();
                            }
                        }
                    }
                }
            }
        }

        function page_zhanshi() {
            document.getElementById('page_one').style.display = 'inline-block';
        }

        function page_yincang() {
            document.getElementById('page_one').style.display = 'none';
        }

        // 来文详情页撤回、终止、作废操作
        function operate_button(ele_id) {
            var url = window.location.href;
            var id = url.split("id=")[1];
            console.log(ele_id)
            if (ele_id === 'is_stop') {
                var state = 'stop';     // 终止
                var word = '终止'
            } else {
                state = 'recall'
                word = '撤回'
            }
            var r = confirm('是否' + word + '流程？')
            if (r === true) {
                var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/administrative/official_documents_cancel_view", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("state=" + state + "&id=" + id)
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            alert(JsonDate['message'])
                            window.location.href = "/personal-center/superiorJeremy.html"
                        }
                    }
                };
            }
        }

        function scrollConversationScreen() {
            $('#selected-div').scrollTop($('#selected-div')[0].scrollHeight);
        }
    </script>
{% endblock %}
